#ifndef Registry_h
#define Registry_h

#include <stdexcept>

namespace serika
{
	namespace ut
	{
		template<class T>
		class Registry
		{
		private:
			Registry() {}
			~Registry() {}

		public:
			static Registry& Instance()
			{
				static Registry<T> instance;
				return instance;
			}

			static T* Get()
			{
				return Registry::Instance().GetT();
			}

			static void Set(T* t)
			{
				Registry::Instance().SetT(t);
			}

		private:
			T* GetT();
			void SetT(T* t) { mT	 = t; }

		private:
			T* mT;
		};

		template<class T>
		T* Registry<T>::GetT()
		{
			return mT;
		}
	}
}

#endif
